package client;

import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author piotrek
 */
public class Slowniki extends Module {
    private ResultSet rset;

    public Slowniki(String username, char[] password, String server) throws SQLException {
        super(username,password,server);
        columns=2;
    }

    @Override
    public void loadTable() {
        try {
            rset = null;
            set.clear();
            rset = stmt.executeQuery("select slownik_autobusow_id,typ" + " from slownik_autobusow");
            while (rset.next()) {
                Object[] tmp = new Object[columns];
                for (int i = 0; i < columns; i++) {
                    tmp[i] = rset.getObject(i + 1);
                }
                set.add(tmp);
            }
        } catch (SQLException ex) {
            System.out.println(ex.getMessage());
        }
    }
}
